<?php

namespace App\Http\Requests\Frontend\V10\Users;

use App\Rules\MobileCheck;
use Illuminate\Foundation\Http\FormRequest;

class UserPhoneServiceStoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'task_id'=>'required',
            'code'=>'required',
            'phone'=>['required',new MobileCheck],
            'message'=>'nullable',
        ];
    }

    public function messages()
    {
        return [
            'phone.required'=>'手机不能为空',
            'task_id.required'=>'任务信息不能为空',
            'code.required'=>'状态码不能为空',
        ];
    }
}
